package boot3.mapper;

import boot3.pojo.Project;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ProjectMapper {
    //获取学院的所有科创项目
    @Select("select * from project where college=#{college}")
    public List<Project> findProjectByCollege(String college);
    //获取全校的科创项目
    @Select("select * from project")
    public List<Project> findAllProject();
    //根据老师的ID获取老师管理的所有科创项目
    @Select("select * from project where admin_id=#{teacher_id}")
    public List<Project> findProjectByTeacher(String teacher_id);
    //新增一个大创
    @Insert("insert project value(#{project_id},#{project_name},#{college},#{start_time},#{introduce}," +
            "#{project_type},#{end_time},#{admin_id},#{admin_name},#{exist_number},#{all_number},#{requirement},#{watch})")
    public Boolean addProject(Project project);
    //删除一个科创
    @Delete("delete from project where project_id=#{project_id}")
    public Boolean deleteProject(String project_id);
    //将一个科创置为不可见
    @Update("update project set watch=false where project_id=#{project_id}")
    public Boolean setProjectNotShow(String project_id);
}
